/**
 * 求职简历
 *
 * @date 2020-08-03
 * @author 逗号米
 */

import * as http from '@/http'
import * as api from '@/api/cms/personal/resume'

/**
 * 首页
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const index = (params?: any): Promise<any> => http.get(api.index, params)

/**
 * 查询
 *
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const query = (params?: any): Promise<any> => http.get(api.query, params)

/**
 * 存储
 *
 * @params params
 * @return {Promise<any>}
 */
export const store = (params: any): Promise<any> => http.post(api.store, params)

/**
 * 显示
 *
 * @params {Number} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const show = (id: number, params?: any): Promise<any> => http.get(api.show(id), params)

/**
 * 更新
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const update = (id: number, params: any): Promise<any> => http.put(api.update(id), params)

/**
 * 删除
 *
 * @params {Number} id 主键
 * @params {Object} [params] 参数
 * @return {Promise<any>}
 */
export const destroy = (id: number, params?: any): Promise<any> => http.del(api.destroy(id), params)

/**
 * 审核简历
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
 export const auditResume = (params: any): Promise<any> => http.put(api.auditResume, params)

/**
 * 审核头像
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
 export const auditAvatar = (params: any): Promise<any> => http.put(api.auditAvatar, params)

/**
 * 更新头像
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateAvatar = (id: number, params: any): Promise<any> => http.put(api.updateAvatar(id), params)

/**
 * 删除头像
 *
 * @params {Number} id 主键
 * @return {Promise<any>}
 */
export const deleteAvatar = (id: number): Promise<any> => http.del(api.deleteAvatar(id))

/**
 * 更新基本信息
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateBasic = (id: number, params: any): Promise<any> => http.put(api.updateBasic(id), params)

/**
 * 更新求职意向
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateJobIntention = (id: number, params: any): Promise<any> => http.put(api.updateJobIntention(id), params)

/**
 * 更新自我介绍
 *
 * @params {Number} id 主键
 * @params {Object} params 参数
 * @return {Promise<any>}
 */
export const updateIntroduction = (id: number, params: any): Promise<any> => http.put(api.updateIntroduction(id), params)
